import request from '@/utils/request'

export function departmentAdd(opt) {
  return request({
    url: '/department/add.json',
    method: 'post',
    data: {
      hid: opt.hid,
      name: opt.name
    }
  })
}

export function departmentUpdate(opt) {
  return request({
    url: '/department/update.json',
    method: 'post',
    data: {
      id: opt.id,
      hid: opt.hid,
      name: opt.name
    }
  })
}

export function departmentGetList(query) {
  return request({
    url: '/department/getList.json',
    method: 'get',
    params: query
  })
}

export function departmentGet(query) {
  return request({
    url: '/department/get.json',
    method: 'get',
    params: query
  })
}

export function departmentDelete(query) {
  return request({
    url: '/department/delete.json',
    method: 'get',
    params: query
  })
}
